home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / Sample Code Update 01⁄96 / Fragment Tool / Sources / FragmentTool.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-20  |  3.0 KB  |  210 lines  |  [TEXT/MPCC]

  1. /*
  2.     File:        FragmentTool.h
  3.  
  4.     Contains:    Common header file included by all source files
  5.  
  6.     Written by:    Chris White, Developer Technical Support
  7.     
  8.     Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  9.     
  10.     Change History (most recent first):
  11.     
  12.                   9/28/95    CW        First release
  13.  
  14. */
  15.  
  16.  
  17.  
  18. #ifndef __FRAGMENTTOOL__
  19. #define __FRAGMENTTOOL__
  20.  
  21.  
  22.  
  23. #ifndef __WINDOWS__
  24.     #include <Windows.h>
  25. #endif
  26.  
  27. #ifndef __FILES__
  28.     #include <Files.h>
  29. #endif
  30.  
  31. #include <Drag.h>
  32. #include <Lists.h>
  33. #include <Types.h>
  34. #include <Dialogs.h>
  35.  
  36.  
  37.  
  38.  
  39. #define DEBUGGING    1
  40.  
  41.  
  42. #define kFourQuestionMarks        0x3F3F3F3F        
  43.  
  44.  
  45. enum
  46. {
  47.     /* File types & creators */
  48.     
  49.     kCreatorCode = 'frgt'
  50. };
  51.  
  52.  
  53.  
  54. enum
  55. {
  56.     /* Internal error codes */
  57.     
  58.     kGenericError = 1,
  59.     kNeedSystem7,
  60.     kCFMNotPresent,
  61.     kMixedModeNotPresent,
  62.     kDragManagerNotPresent
  63. };
  64.  
  65.  
  66.  
  67. enum
  68. {
  69.     // Error strings
  70.     
  71.     
  72.     kGenericErrorStr = 4,
  73.     kUnresolvedDependenciesStr = 5,
  74.     kFileOpenStr = 6
  75. };
  76.  
  77.  
  78.  
  79. enum
  80. {
  81.     kDAWindowType = 100,
  82.     kDocumentWindowType,
  83.     kListWindowType,
  84.     kGetInfoWindowType,
  85.     kMoveFragmentWindowSubType,
  86.     kCopyFragmentWindowSubType
  87. };
  88.  
  89.  
  90.  
  91. enum
  92. {
  93.     kNotCancelled = false, 
  94.     kCancelled = true
  95. };
  96.  
  97. #define    kDisplayWindow    1000
  98.  
  99.  
  100.  
  101.  
  102. #define    kAboutDialog            1001
  103. #define    kErrorDialog            1002
  104. #define kSaveDontsaveDialog        2003
  105. #define rErrorStrings            1002
  106.  
  107. typedef    Byte        int8;    
  108. typedef    short        int16;
  109. typedef    long        int32;
  110.  
  111.  
  112.  
  113.  
  114. typedef struct WindowInfo
  115. {
  116.     Boolean        bUntitled;
  117.     Boolean        bDirty;
  118.     ListRef        listRef;
  119.     Handle        dataHandle;
  120.     FSSpec        fileSpec;
  121.     
  122. } tWindowInfo, *tWindowInfoPtr;
  123.  
  124.  
  125. typedef struct DialogInfo
  126. {
  127.     int16        windowType;
  128.     int16        windowSubType;
  129.     ListHandle    listRef;
  130.     int32        refCon;
  131.     
  132. } tDialogInfo, *tDialogInfoPtr;
  133.  
  134.  
  135.  
  136.  
  137. typedef struct DrawingWindow DrawingWindow, *DrawingWindowPeek;
  138.  
  139.  
  140.  
  141. typedef OSErr (*tContentsProcPtr) ( ListRef theList, void* refCon );
  142.  
  143.  
  144.  
  145.  
  146. struct AddFragmentsRecOut
  147. {
  148.     int16    theFileRef;
  149. };
  150.  
  151.  
  152. struct AddFragmentsRecIn
  153. {
  154.     Handle    theDataHandle;
  155. };
  156.  
  157.  
  158. typedef struct AddFragmentsRec
  159. {
  160.     union
  161.     {
  162.         struct AddFragmentsRecOut    out;
  163.         struct AddFragmentsRecIn    in;
  164.     } u;
  165.     
  166. } tAddFragmentsRec;
  167.  
  168.  
  169.  
  170. typedef struct DragData
  171. {
  172.     WindowRef    theWindow;
  173.     int16        theIndex;
  174. } tDragData;
  175.  
  176.  
  177.  
  178.  
  179. /* Global Variable Definitions */
  180.  
  181.  
  182.  
  183. /*
  184.    This allows me to include this file in all sources with the 
  185.    extern keyword used in all instances except the main source file.
  186. */
  187.  
  188. #ifdef __MAIN__
  189.     #define    global
  190. #else
  191.     #define    global    extern
  192. #endif
  193.  
  194.  
  195. global    Boolean                    gQuit;                  /* quit program flag */
  196. global    int32                    gSleepTime;
  197. global    int16                    gMenuState;                /* In what state did we last leave our menu bar? */
  198. global    WindowRef                gCurrentWindow;            /* Which window are we redrawing? */
  199. global    Handle                    gCommonMenuBar;            /* The menubar for the app itself, with no tool menus */
  200.  
  201. global    Boolean                    gHasDragManager;        /* Is the Drag Manager available? */
  202. global     UserItemUPP                gOutlineUserItemUPP;
  203. global    DragTrackingHandlerUPP    gDragTrackingHandlerUPP;
  204. global    DragReceiveHandlerUPP    gDragReceiveHandlerUPP;
  205. global    DragSendDataUPP            gDragSendDataProcUPP;
  206. global    ListClickLoopUPP        gClickLoopUPP;
  207.  
  208.  
  209. #endif    // __FRAGMENTTOOL__
  210.